<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<!DOCTYPE html>
<html lang="fr">
	<head>
		<title>Back office Bitstrip(s) - Gérer les thèmes</title>
		<meta charset="UTF-8"/>
		<link rel="stylesheet" type="text/css" href="/bitstrip/assets/css/back_office.css"/>        
        <link href='http://fonts.googleapis.com/css?family=PT+Sans:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
		<jsp:include page="menu_bo.jsp"/>
	</head>
	<body>
		<div class="bo-container"> 
			<h1>Mots clés</h1>
			<a href="ajouter_mot_cle.action">Ajouter un mot clé</a>
			<c:if test="${empty rechercheMotsCles}">
				<h2>Actuellement aucun mot clé n'est disponible</h2>
				<input type="button" name="cancel" value ="Annuler" onclick="history.go(-1)">
			</c:if>
			<c:if test="${not empty rechercheMotsCles}">
				 <form:form commandName="recherche" action="recherche.action" method="post">
				 	<form:errors path="*" />
					<input type="text" name="search" value="" size="25"  placeholder = "MOT CLE"/>
					<input type="submit" name="rechercher" value="Rechercher" />
				</form:form>
				<form:form commandName="gerer_mot_cle" action="gerer_mot_cle.action" method="post">
					<div class="tableau">
						<table>
							<c:forEach var="motCle" items="${rechercheMotsCles}">
								<tr>
									<td><a href="gerer_mot_cle.action?id=${motCle.id}">${motCle.label}</a></td>
									<td><input type="checkbox" name="check" value="${motCle.id}"/></td>
								</tr>
							</c:forEach>
						</table>
					</div>
					<input type="submit" name="valider" value="Supprimer" />
				</form:form>	
			</c:if>
		</div>
	</body>
</html>